POV-Ray : Newsgroups : povray.newusers : splines of variable length : Re: splines of variable length Server Time
30 Jul 2024 14:19:41 EDT (-0400)
  Re: splines of variable length  
From: Hughes, B 
Date: 21 Feb 2004 17:12:03
Message: <4037d7b3@news.povray.org>
"bongotastic" <cbl### [at] csdalca> wrote in message
news:4037ae92$1@news.povray.org...
>
>     I would like to display sphere_sweep(s) of a variable length. Here is
> approximatively what I want to do:
>
> #while(some_condition)
> #declare n = Rand_Poisson(10,myseed);
> // generate an array of n points according to some process
> {...}
> // Draw a sphere_sweep such that
> sphere_sweep{
>     cubic_spline
>     n,
>     // My n points here
>     ...
>     texture{...}
> }
> #end // end while loop
>
>     I can't find any example doing something similar. Is it possible or
must
> all spline length must be hard coded?

sphere_sweep doesn't seem to accept all the points given it by #while loop,
from what I've found. Take the following script as an example:

#declare SpaceTime=
spline {
 linear_spline
  0.0, <-50, 0, 0>,
  0.1, <-50, 0, -20>,
  0.2, <-20, 0, -20>,
  0.3, <-20, 0, 0>,
  0.4, <0, 0, 0>,
  0.5, <30, 0, 0>,
  0.6, <30, 0, 10>,
  0.7, <40, 0, 10>,
  0.8, <40, 0, 20>,
  0.9, <80, 0, 20>,
  1.0, <80, 0, 20>
}

#macro SphereSweep(P,F)
#local Frame=frame_number+F;
 linear_spline
 Frame,
 SpaceTime(0),1
 #while (P<Frame)
 SpaceTime(clock),1
 #local P=P+1;
 #end
#end

sphere_sweep {
 SphereSweep(1,2)

pigment {color rgb 1}
}

What happens is that only the first and then last point, produced in the
loop, is actually plotted leaving the others out. Makes a single line
without any corners, such as were planned in the SpaceTime() spline.

Sorry that I'm of no help. Of course, this doesn't mean there's not another
way until disproven.

-- 
Bob H.
http://www.3digitaleyes.com


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.